<template>
  <!-- 学生方案管理界面 -->
  <div class="manage-center">

    <div class="search-box">
      <div class="search-left">
        <div class="search-item">
          <span class="label">姓名：</span>
          <el-autocomplete
              class="inline-input"
              v-model="searchParams.name"
              :fetch-suggestions="queryStuSearch"
              placeholder="请输入"
              :trigger-on-focus="false"
              size="mini">
          </el-autocomplete>
        </div>
        <div class="search-item">
          <span class="label">学校：</span>
          <el-autocomplete
              class="inline-input"
              v-model="searchParams.school"
              :fetch-suggestions="querySchoolSearch"
              placeholder="请输入"
              :trigger-on-focus="false"
              size="mini">
          </el-autocomplete>
        </div>
        <div class="search-item">
          <span class="label">高考年份：</span>
          <el-date-picker v-model="searchParams.year" type="year"  placeholder="选择年份" value-format="yyyy" >
          </el-date-picker>
        </div>
        <div class="search-item">
          <el-button type="primary" size="medium" @click="searchFn" >查询</el-button>
          <el-button type="primary" plain size="medium" @click="resetSearchFn" >重置</el-button>
        </div>
      </div>
      <div>
        <el-button type="primary" size="medium" @click="addDialogFlag = true">添加考生</el-button>
        <el-button type="primary" size="medium" @click="bindDialogFlag = true">绑定考生</el-button>
      </div>
    </div>
    <div class="table-section">
      <el-table :data="studentList" class="ui-table">
        <el-table-column fixed prop="stuNum" label="编号" width="50" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.stuNum }}</span>
          </template>
        </el-table-column>
        <el-table-column
            prop="name"
            align="center"
            label="姓名">
        </el-table-column>
        <el-table-column
            prop="school"
            label="就读学校"
            align="left"
            min-width="140px">
          <template slot-scope="scope">
            <p style="text-align: left">{{ scope.row.school }}</p>
          </template>
        </el-table-column>
        <el-table-column
            prop="sex"
            label="性别"
            align="center"
            min-width="50">
          <template slot-scope="scope">
            <span v-if="scope.row.sex == 0">男</span>
            <span v-if="scope.row.sex == 1">女</span>
          </template>
        </el-table-column>
        <el-table-column
            prop="major"
            label="科类"
            align="center"
            min-width="66">
          <template slot-scope="scope">
            <span v-if="scope.row.major == 1">物理</span>
            <span v-if="scope.row.major == 2">历史</span>
<!--            <span v-if="scope.row.major == 3">艺术理</span>-->
<!--            <span v-if="scope.row.major == 4">艺术文</span>-->
          </template>
        </el-table-column>
        <el-table-column
            prop="other"
            label="高考年份"
            align="center"
            min-width="80px">
        </el-table-column>
        <el-table-column
            prop="score"
            label="分数"
            align="center"
            min-width="60px">
        </el-table-column>
        <el-table-column
            prop="precedence"
            label="高考位次"
            align="center"
            min-width="80px">
        </el-table-column>
        <el-table-column
            prop="chinese"
            label="语文"
            align="center"
            min-width="50px">
        </el-table-column>
        <el-table-column
            prop="manth"
            label="数学"
            align="center"
            min-width="50px">
        </el-table-column>
        <el-table-column
            prop="english"
            label="外语"
            align="center"
            min-width="50px">
        </el-table-column>
        <el-table-column
            prop="comprehensive"
            label="综合"
            align="center"
            min-width="50px">
        </el-table-column>
        <el-table-column
            prop="biology"
            label="口试"
            align="center"
            min-width="50px">
        </el-table-column>
        <el-table-column
            prop="cardCode"
            label="卡号"
            align="center"
            min-width="120px">
        </el-table-column>
        <el-table-column
            label="操作"
            align="center"
            width="310px">
          <template slot-scope="scope">
            <el-button type="primary" size="mini" plain @click="goManagement(scope.row)">管理</el-button>
            <el-button type="primary" size="mini" plain @click="updateOpen(scope.row, scope.$index)">修改</el-button>
            <el-button type="primary" size="mini" plain @click="delStuFn(scope.row.id,scope.$index,studentList)">删除</el-button>
            <el-button v-if="scope.row.rank==0" type="primary" size="mini" plain @click="lockStuFn(scope.row,1)">锁定</el-button>
            <el-button v-if="scope.row.rank==1" type="primary" size="mini" plain @click="lockStuFn(scope.row,0)" >解锁</el-button>
            <el-popover
                placement="top-start"
                width="300"
                trigger="hover"
                content="注意：点击“锁定”后，绑定的学生账户将不可修改“建立档案”和“定位专业”页面信息，请务必在完成预案咨询后再执行此操作！">
              <i class="el-icon-question" slot="reference" style="color: #909399;vertical-align: middle;margin-left: 5px;"></i>
            </el-popover>

          </template>
        </el-table-column>
      </el-table>
      <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageNum"
          :page-sizes="[15, 30, 50, 100]"
          :page-size="pageSize"
          next-text="下一页"
          prev-text="上一页"
          v-if="stuTotal > 0"
          layout="total, sizes, prev, pager, next"
          :total="stuTotal" ref="pagination" style="padding-top: 10px;">
      </el-pagination>
    </div>

    <el-dialog class="dialog-section" title="添加学生" :visible.sync="addDialogFlag" :close-on-click-modal="false" @close="closeDialogFn">
      <el-form :inline="true" ref="form" :model="addStudentForm" label-width="90px" >
        <el-form-item label="*姓名" prop="name">
          <el-input v-model="addStudentForm.name" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="性别" prop="sex">
          <el-select v-model="addStudentForm.sex" placeholder="请选择">
            <el-option :key="0" :label="'男'" :value="0"></el-option>
            <el-option :key="1" :label="'女'" :value="1"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="学校" prop="school">
          <el-input v-model="addStudentForm.school" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="*科类" prop="major">
          <el-select v-model="addStudentForm.major" placeholder="请选择">
            <el-option :key="1" :label="'物理'" :value="1"></el-option>
            <el-option :key="2" :label="'历史'" :value="2"></el-option>
<!--            <el-option :key="3" :label="'艺术理'" :value="3"></el-option>-->
<!--            <el-option :key="4" :label="'艺术文'" :value="4"></el-option>-->
          </el-select>
        </el-form-item>
        <el-form-item label="*再选科目1" prop="subject1">
            <el-select v-model="addStudentForm.subject1" placeholder="请选择">
                <el-option :key="1" :label="'化学'" :value="'化学'"></el-option>
                <el-option :key="2" :label="'生物'" :value="'生物'"></el-option>
                <el-option :key="3" :label="'政治'" :value="'政治'"></el-option>
                <el-option :key="4" :label="'地理'" :value="'地理'"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="*再选科目2" prop="subject2">
            <el-select v-model="addStudentForm.subject2" placeholder="请选择">
                <el-option :key="1" :label="'化学'" :value="'化学'"></el-option>
                <el-option :key="2" :label="'生物'" :value="'生物'"></el-option>
                <el-option :key="3" :label="'政治'" :value="'政治'"></el-option>
                <el-option :key="4" :label="'地理'" :value="'地理'"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="分数" prop="score">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.score"></el-input>
        </el-form-item>
        <el-form-item label="位次" prop="precedence">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.precedence"></el-input>
        </el-form-item>
        <el-form-item label="*高考年份" prop="other">
          <el-date-picker placeholder="请选择" v-model="addStudentForm.other" type="year" value-format="yyyy" ></el-date-picker>
        </el-form-item>
        <el-form-item label="语文" prop="chinese">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.chinese"></el-input>
        </el-form-item>
        <el-form-item label="数学" prop="manth">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.manth"></el-input>
        </el-form-item>
        <el-form-item label="外语" prop="english">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.english"></el-input>
        </el-form-item>
        <el-form-item label="综合" prop="comprehensive">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.comprehensive"></el-input>
        </el-form-item>
        <el-form-item label="口试" prop="biology">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.biology"></el-input>
        </el-form-item>
        <el-form-item label="编号" prop="stuNum">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="addStudentForm.stuNum"></el-input>
        </el-form-item>
        <div class="btn-box">
          <el-button type="primary" @click="submitStuFn()" >立即创建</el-button>
        </div>
      </el-form>

    </el-dialog>

    <el-dialog class="dialog-section" title="绑定考生" :visible.sync="bindDialogFlag" :close-on-click-modal="false" @close="closeDialogFn">
      <p style="text-align: center;color: red;">注:根据已注册学生卡号及姓名绑定该学生</p>
      <el-form :inline="true" ref="bindStudentForm" :model="bindStudentForm" label-width="90px" >
        <el-form-item label="*学生姓名" prop="name">
          <el-input v-model="bindStudentForm.name" ></el-input>
        </el-form-item>
        <el-form-item label="*会员卡号" prop="number">
          <el-input v-model="bindStudentForm.cardNumber" ></el-input>
        </el-form-item>
        <div class="btn-box">
          <el-button type="primary" @click="submitBindStuFn()">立即绑定</el-button>
        </div>
      </el-form>

    </el-dialog>

    <el-dialog class="dialog-section" title="修改学生信息" :visible.sync="updateDialogFlag" :close-on-click-modal="false" @close="closeDialogFn">
      <el-form :inline="true" ref="updateStudentForm" :model="updateStudentForm" label-width="90px">
        <el-form-item label="姓名" prop="school" v-show="!updateStudentForm.cardCode">
          <el-input v-model="updateStudentForm.name" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="性别" prop="sex" v-show="!updateStudentForm.cardCode">
          <el-select v-model="updateStudentForm.sex" placeholder="请选择">
            <el-option :key="0" :label="'男'" :value="0"></el-option>
            <el-option :key="1" :label="'女'" :value="1"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="学校" prop="school" v-show="!updateStudentForm.cardCode">
          <el-input v-model="updateStudentForm.school" placeholder="请输入"></el-input>
        </el-form-item>
        <el-form-item label="科类" prop="major" v-show="!updateStudentForm.cardCode">
          <el-select v-model="updateStudentForm.major" placeholder="请选择">
            <el-option :key="1" :label="'物理'" :value="1"></el-option>
            <el-option :key="2" :label="'历史'" :value="2"></el-option>
<!--            <el-option :key="3" :label="'艺术理'" :value="3"></el-option>-->
<!--            <el-option :key="4" :label="'艺术文'" :value="4"></el-option>-->
          </el-select>
        </el-form-item>
        <el-form-item label="*再选科目1" prop="subject1">
            <el-select v-model="updateStudentForm.subject1" placeholder="请选择">
                <el-option :key="1" :label="'化学'" :value="'化学'"></el-option>
                <el-option :key="2" :label="'生物'" :value="'生物'"></el-option>
                <el-option :key="3" :label="'政治'" :value="'政治'"></el-option>
                <el-option :key="4" :label="'地理'" :value="'地理'"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="*再选科目2" prop="subject2">
            <el-select v-model="updateStudentForm.subject2" placeholder="请选择">
                <el-option :key="1" :label="'化学'" :value="'化学'"></el-option>
                <el-option :key="2" :label="'生物'" :value="'生物'"></el-option>
                <el-option :key="3" :label="'政治'" :value="'政治'"></el-option>
                <el-option :key="4" :label="'地理'" :value="'地理'"></el-option>
            </el-select>
        </el-form-item>
        <el-form-item label="分数" prop="score">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.score"></el-input>
        </el-form-item>
        <el-form-item label="位次" prop="precedence">
          <el-input placeholder="请输入" v-model="updateStudentForm.precedence"></el-input>
        </el-form-item>
        <el-form-item label="语文" prop="chinese">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.chinese"></el-input>
        </el-form-item>
        <el-form-item label="数学" prop="manth">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.manth"></el-input>
        </el-form-item>
        <el-form-item label="外语" prop="english">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.english"></el-input>
        </el-form-item>
        <el-form-item label="综合" prop="comprehensive">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.comprehensive"></el-input>
        </el-form-item>
        <el-form-item label="口试" prop="biology">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.biology"></el-input>
        </el-form-item>
        <el-form-item label="编号" prop="stuNum">
          <el-input placeholder="请输入" onkeyup="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" v-model="updateStudentForm.stuNum"></el-input>
        </el-form-item>
        <div class="btn-box">
          <el-button type="primary" @click="updateStuFn()">确认修改</el-button>
        </div>
      </el-form>

    </el-dialog>

    <div v-if="user.userType == 3" class="right-btn-box">
      <el-button circle @click="goRecycle()">回收站</el-button>
    </div>
  </div>
</template>

<script>
import { request } from "@/util/request"

export default {
  data() {
    return {
      // 用户信息
      user: {},
      // 搜索条件
      stuNames: [],
      schoolsList: [],
      searchParams: {
        id: '',
        name: '',
        school: '',
        year: '',
      },
      // 学生列表
      studentList: [],
      pageNum: 1,
      pageSize: 15,
      stuTotal: 0,
      // dialog
      addDialogFlag: false,
      bindDialogFlag: false,
      updateDialogFlag: false,
      addStudentForm: {},
      bindStudentForm: {},
      updateStudentForm: {}
    }
  },
  methods: {
    // 初始页pageNum、初始每页数据数pagesize和数据data
    handleSizeChange (size) {
      this.pageSize = size;
      this.getStudentList()
    },
    handleCurrentChange (currentPage) {
      this.pageNum = currentPage;
      this.getStudentList()
    },
    updateStuFn() {
      if (this.updateStudentForm.name && this.updateStudentForm.major || this.updateStudentForm.cardCode) {
        if (this.updateStudentForm.subject1 == this.updateStudentForm.subject2) {
            this.$message({
                message: '再选科目1和再选科目2不能相同！',
                type: 'error'
            });
            return;
        }
        request({
          method: 'post',
          url: 'students/saveOrUpdateArchives',
          data: this.updateStudentForm
        }).then(res => {
          if (res.code == 0) {
            this.$message({
              message: '操作成功！',
              type: 'success'
            });
            this.resetSearchFn()
            this.updateDialogFlag = false;
          } else {
            this.$message({
              message: '操作失败~',
              type: 'error'
            });
          }
          return;
        })
      } else {
        this.$message({
          message: '姓名与科类不能为空！',
          type: 'error'
        });
      }

    },
    // 显示更新学生学具弹窗
    updateOpen(row, index) {
      this.updateDialogFlag = true
      this.updateStudentForm = JSON.parse(JSON.stringify(row))
      this.updateStudentForm.index = index;
    },
    lockStuFn(row, rank) {
      let student = {"id": row.id, "rank": rank}
      request({
        method: 'post',
        url: 'students/saveOrUpdateArchives',
        data: student
      }).then(res => {
        if (res.code == 0 || res.code == 200) {
          this.$message({
            message: '操作成功！',
            type: 'success'
          });
          this.$router.go(0)
        } else {
          this.$message({
            message: '操作失败~',
            type: 'error'
          });
          this.$router.go(0)
        }

      })
    },
    // 删除学生
    delStuFn (id, index, row) {
      this.$confirm('确定删除该学生嘛?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        request({
          method: 'get',
          url: 'students/deleteStu',
          params: {
            id: id
          }
        }).then(msg => {
          if (msg.code == 0 || msg.code == 200) {
            this.$message({
              message: "删除成功！",
              type: 'success'
            });
            row.splice(index, 1);
          } else {
            this.$message({
              message: "删除失败！",
              type: 'error'
            });
          }
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });

    },
    // 关闭弹窗
    closeDialogFn () {
      this.addStudentForm = {}
      this.bindStudentForm = {}
      this.updateStudentForm = {}
    },
    // 绑定考生
    submitBindStuFn () {
      if (this.bindStudentForm.cardNumber == null || this.bindStudentForm.cardNumber == '') {
        this.$message({
          message: '卡号不能为空！',
          type: 'error'
        })
      } else if (this.bindStudentForm.name == null || this.bindStudentForm.name == '') {
        this.$message({
          message: '姓名不能为空！',
          type: 'error'
        })
      } else {
        this.bindStudentForm.userId = JSON.parse(sessionStorage.getItem("user")).userId
        request({
          method: 'post',
          url: 'sysUser/bindingStu',
          data: this.bindStudentForm
        }).then(msg => {
          if (msg.code == 0 || msg.code == 200) {
            this.$message({
              message: msg.msg,
              type: 'success'
            });
            this.bindDialogFlag = false
            this.getStudentList()
          } else {
            this.$message({
              message: msg.msg,
              type: 'error'
            });
          }
        })
      }
    },
    // 提交学生信息
    submitStuFn () {
      this.addStudentForm.createdUser = this.user.userId
      if (this.addStudentForm.name == null || this.addStudentForm.name == '') {
        this.$message({
          message: '学生姓名不能为空！',
          type: 'error'
        });
      } else if (this.addStudentForm.other == null || this.addStudentForm.other == '') {
        this.$message({
          message: '高考年份不能为空！',
          type: 'error'
        });
      } else if (this.addStudentForm.major == null || this.addStudentForm.major == '') {
        this.$message({
          message: '科类不能为空！',
          type: 'error'
        });
      } else if (this.addStudentForm.subject1 == null || this.addStudentForm.subject1 == '') {
          this.$message({
              message: '再选科目1不能为空！',
              type: 'error'
          });
      } else if (this.addStudentForm.subject2 == null || this.addStudentForm.subject2 == '') {
          this.$message({
              message: '再选科目2不能为空！',
              type: 'error'
          });
      } else if (this.addStudentForm.subject1 == this.addStudentForm.subject2) {
          this.$message({
              message: '再选科目1和再选科目2不能相同！',
              type: 'error'
          });
      }else {
        request({
          method: 'post',
          url: 'students/saveOrUpdateArchives',
          data: this.addStudentForm
        }).then(msg => {
          if (msg.code == 0 || msg.code == 200) {
            this.$message({
              message: "添加成功！",
              type: msg.msg
            });
            this.getStudentList()
            this.addDialogFlag = false
          } else {
            this.$message({
              message: msg.msg,
              type: 'error'
            });
          }
        })
      }

    },
    // 搜索
    searchFn () {
      this.pageNum = 1
      this.getStudentList()
    },
    // 搜索重置
    resetSearchFn () {
      this.searchParams.school = null
      this.searchParams.name = null
      this.searchParams.year = null
      this.pageNum = 1
      this.getStudentList()
    },
    // 获取学生列表
    getStudentList () {
      request({
        method: 'Get',
        // url: 'students/getStudent',
        url: 'students/getOneStudentPage',
        params: {
          id: this.user.userId,
          pageNum: this.pageNum,
          pageSize: this.pageSize,
          name: this.searchParams.name,
          school: this.searchParams.school,
          year: this.searchParams.year
        }
      }).then(res => {
        if (res.code == 0) {
          this.stuTotal = res.data.total
          this.studentList = res.data.list
          this.studentList.forEach(i => {
            this.stuNames.push({"value": i.name})
            if (i.school != null) {
              this.schoolsList.push({"value": i.school})
            }
          })
        }
      })
    },
    // 跳转
    goManagement(row) {
      localStorage.setItem('stu', JSON.stringify(row))
      this.$router.push({
        path: '/designV2/management',
        params: {
          info: row
        }
      })
    },
    // 远程检索学生
    queryStuSearch(queryString, cb) {
      var restaurants = this.stuNames;
      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    // 远程检索学校
    querySchoolSearch(queryString, cb) {
      var restaurants = this.schoolsList;
      var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
      //增加去重
      let res = new Map();
      results = results.filter( (list) => !res.has(list.value) && res.set(list.value, 1) );
      // 调用 callback 返回建议列表的数据
      cb(Array.from(new Set(results)));
    },
    createFilter(queryString) {
      return (restaurant) => {
        return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) !== -1);
      };
    },
    // 跳转回收站
    goRecycle () {
      this.$router.push({
        path: "/recycle",
        query: {
          page: "/designV2"
        }
      })
    }
  },
  created() {
    const user = sessionStorage.getItem("user");
    this.user = JSON.parse(user)
    this.searchParams.id = this.user.userId
    this.getStudentList()

  }
}
</script>

<style lang="stylus">
.manage-center
  .el-table th.el-table__cell
    background-color: #f0f0f0;
  .dialog-section
    .el-dialog
      width: 960px;
    .el-form
      margin: 0 auto;
      .el-input
        width: 200px;
  .right-btn-box
    position: fixed;
    top: 50%;
    right: 10px;
    z-index: 100;
    margin-top: -30px;
    width: 60px;
    height: 60px;
    .el-button
      width: 60px;
      height: 60px;
      padding: 0;
      text-align center
      background-color: green;
      color: white;
</style>
<style lang="stylus" scoped>
pageWidth = 1400px
div
 box-sizing: border-box
.manage-center
  width: pageWidth;
  min-height: BodyMinHeight;
  margin: 0 auto;
  padding: 0 40px;
  font-size: 16px;

  .search-box
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    .search-left
      display: flex;
      align-items: center;
      justify-content: flex-start;
    .search-item
      display: flex;
      align-items: center;
      margin-right: 20px;
      .label
        margin-right: 10px;


  .table-section
    padding-bottom: 40px;

  .dialog-section
    .btn-box
      text-align: center;

.ui-table /deep/ th.el-table__cell
  padding 12px 0
</style>
